const vm = new Vue({
    el: '#main',
    data: {
        list: [],
    },
    methods: {
        showCommentDetail,
    },
});

function apiready() {
    fxj.fixLayout();
    reqCommentList();
}

async function reqCommentList() {
    const result = await ajax({
        url: 'home/houseDetail/getHouseComments',
        data: {
            houseId: fxj.getSearch().get('id'),
            pageNum: 1,
        },
    });
    if (result.data.length > 0) {
        vm.list = result.data;
    }
}

function showCommentDetail(id) {
    goPage('comment_detail.html', {
        data: {
            id,
            type: '1',
        },
    });
}